﻿<Page x:Class="ChessChallenge.Views.BoardView"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:local="clr-namespace:ChessChallenge.Views"
      mc:Ignorable="d" 
      d:DesignHeight="800" d:DesignWidth="800"
      Title="BoardView" >

    <Page.Resources>
        <local:BackgroundColorConverter x:Key="ColorConverter"/>
    </Page.Resources>
    <Grid>
        <ListBox ItemsSource="{Binding Path=TestBinding}">
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <UniformGrid Rows="8" Columns="8" MinHeight="80" MaxHeight="800" MinWidth="80" MaxWidth="800" >
                    </UniformGrid>
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Grid Background="{Binding Converter={StaticResource ColorConverter}}" Margin="0"
                           Width="100" Height="100">
                    <TextBlock Text="{Binding Mode=OneTime}" FontSize="40" 
                             VerticalAlignment="Center" HorizontalAlignment="Center"
                             />
                    </Grid>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </Grid>
</Page>
